<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../../commons/taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>挂号查询</title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/static/css/admin.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/static/css/pintuer.css">
<script src="<%=request.getContextPath() %>/static/js/jquery.js"></script>
<script src="<%=request.getContextPath() %>/static/js/pintuer.js"></script>
</head>

<body>
	<!--<form method="post" action="serch">-->
		<div class="panel admin-panel">
			<div class="panel-head">
				<strong class="icon-reorder"> 收费查询</strong>
			</div>
			<div class="padding border-bottom">
				<ul class="search" style="padding-left: 10px;">
					<li><input type="text" placeholder="病人姓名" name="name"
						class="input ys"
						style="width: 250px; line-height: 17px; display: inline-block" />
						<a onclick="fy()" class="button border-main icon-search" type="button">搜索</a>
					</li>
				</ul>
			</div>
	<!--</form>-->
			<table class="table table-hover text-center yp_table">
				<tr>
					<th style="text-align: center;" width="10%">就诊号</th>
					<th style="text-align: center;" width="8%">类别</th>
					<th style="text-align: center;">病人姓名</th>
					<th style="text-align: center;" width="8%">号别</th>
					<th style="text-align: center;" width="8%">诊别</th>
					<th style="text-align: center;" width="15%">科室名称</th>
					<th style="text-align: center;">医生姓名</th>
					<th style="text-align: center;">挂号费</th>
					<th style="text-align: center;" width="16%">药品费用</th>
				</tr>
				
				<c:forEach items="${ list }" var="list">
                    <tr class="tdt">
                        <td>${list.id }</td>
                        <td>${list.category }</td>
                        <td>${list.name }</td>
                        <td>${list.d_type }</td>
                        <td>${list.c_type }</td>
                        <td>${list.d_name }</td>
                        <td>${list.do_name }</td>
                        <td>${list.fee }</td>
                        <td>${list.amount }</td>
                    </tr>
                </c:forEach>
                </table>
                <div class="pagelist">
					<input onclick="fy(1)" type="button" class="pags" id="" value="上一页" />	
				
					<label style="color: blueviolet;" type="button" class="pag" id="" >${pageNumber}</label>&nbsp;&nbsp;&nbsp;
				
					<label style="color: blueviolet;" type="button" class="pag2" id="">${pageNumber+1}</label>
				
					<input onclick="fy(2)" type="button" class="pagx" id="" value="下一页"/>
					
					总共<label id="lable" style="color: red;">${Pages}</label>页
					
				</div>
			
		</div>
	
	<script type="text/javascript">
		//搜索
		function fy(o) {
			var pa;
//			alert($("#lable").html())
			if(o==1){
				var p = $(".pag").html();
				if(p==1){
					alert("到首页")
				}else{
					pa=parseInt(p)-1;
				}
			}
			if(o==2){
				var p = $(".pag").text();
				var o =$("#lable").html();
				if(p==o){
					alert("到末页")
				}else{
					pa=parseInt(p)+1;
				}
			}
			if(o==null){
				pa=1;
			}
			$.post('serch2',{
				name:$(".ys").val(),
				pageNaber:pa
			},function(e){
				$('.tdt').html("");
				var list = e.list;
				$('#lable').text(e.pages);
				$('.pag').text(e.pageNmuber);
				$('.pag2').text(e.pageNmuber+1);
				for(var i=0; i<list.length;i++){
		          	$(".yp_table").append("<tr class='tdt'>"+
		          		"<td>"+list[i].id+"</td>"+
		          		"<td>"+list[i].category+"</td>"+
		          		"<td>"+list[i].name+"</td>"+
		          		"<td>"+list[i].d_type+"</td>"+
		          		"<td>"+list[i].c_type+"</td>"+
		          		"<td>"+list[i].d_name+"</td>"+
		          		"<td>"+list[i].name+"</td>"+
		          		"<td>"+list[i].fee+"</td>"+
		          		"<td>"+list[i].amount+"</td>"+
		          		"</tr>"
		          		)
		       	 }
			});
		}
	</script>
</body>

</html>